<div class="panel panel-default panel-intro">
    <div class="panel-heading">
        <ul class="nav nav-tabs">
            <li class="active"><a href="#t-all" data-toggle="tab">{:__('All')}</a></li>
        </ul>
    </div>
    <div class="panel-body">
        <div id="myTabContent" class="tab-content">
            <div class="tab-pane fade active in" id="t-all">
                <div class="widget-body no-padding">
                    <div class="row">
                        <div class="col-sm-12">
                            <div class="panel panel-default">
                                <div class="panel-heading">
                                    <h3 class="panel-title">生产计划：{$row.plan_name}</h3>
                                </div>
                                <div class="panel-body">
                                    <div class="row">
                                        <div class="col-md-6">
                                            <p><strong>计划编码：</strong>{$row.plan_code}</p>
                                            <p><strong>产品名称：</strong>{$row.product_name}</p>
                                            <p><strong>产品型号：</strong>{$row.product_model}</p>
                                        </div>
                                        <div class="col-md-6">
                                            <p><strong>计划数量：</strong>{$row.total_quantity}</p>
                                            <p><strong>实际数量：</strong>{$row.actual_quantity|default='0'}</p>
                                            <p><strong>完成进度：</strong>{$row.progress|default='0'}%</p>
                                        </div>
                                    </div>
                                </div>
                            </div>
                        </div>
                    </div>
                    
                    <div class="row">
                        <div class="col-sm-12">
                            <div class="panel panel-default">
                                <div class="panel-heading">
                                    <h3 class="panel-title">分工分配列表</h3>
                                </div>
                                <div class="panel-body">
                                    <table class="table table-striped table-bordered table-hover">
                                        <thead>
                                            <tr>
                                                <th>工序名称</th>
                                                <th>工人姓名</th>
                                                <th>分配数量</th>
                                                <th>已报工数量</th>
                                                <th>剩余数量</th>
                                                <th>状态</th>
                                                <th>创建时间</th>
                                            </tr>
                                        </thead>
                                        <tbody>
                                            {foreach $allocations as $allocation}
                                            <tr>
                                                <td>{$allocation.process.name|default='未知工序'}</td>
                                                <td>{$allocation.user.nickname|default='未知工人'}</td>
                                                <td>{$allocation.quantity}</td>
                                                <td>{$allocation.reported_quantity|default='0'}</td>
                                                <td>{$allocation.quantity - $allocation.reported_quantity}</td>
                                                <td>
                                                    {switch $allocation.status}
                                                        {case 0}待开始{/case}
                                                        {case 1}进行中{/case}
                                                        {case 2}已完成{/case}
                                                        {default}未知{/default}
                                                    {/switch}
                                                </td>
                                                <td>{$allocation.createtime|date='Y-m-d H:i:s',###}</td>
                                            </tr>
                                            {/foreach}
                                        </tbody>
                                    </table>
                                </div>
                            </div>
                        </div>
                    </div>
                </div>
            </div>
        </div>
    </div>
</div>
